/*
  学习目标：切换history路由模式
*/

import VueRouter from "vue-router";
import Vue from "vue";

Vue.use(VueRouter);
import HmFind from "../views/HmFind.vue";
import HmMy from "../views/HmMy.vue";
import NotFound from "../views/NotFound.vue";
import Home from "../views/HmHome.vue";

const routes = [
  { path: "/", redirect: "/find" },
  { path: "/find", component: HmFind },
  { path: "/my/:id", component: HmMy, name: "MyName" },
  { path: "/home", component: Home },

  { path: "*", component: NotFound },
];
const router = new VueRouter({
  routes,
  // 带#， 叫hash路由
  // 不带#， 叫history路由
  // 切换路由模式
  // 💥💥 重新打包
  mode: "history",
});

export default router;
